<template>
	<view>
		<view class="header">
			<view class="return"><text class="iconfont icon-zuo icon"></text>返回</view>
			<view class="jilu">问题详情</view>
		</view>
		<view class="center">
			<view class="content">
				<view class="contentSon">
					<view class="contentSon_1">{{DworkerData.address}}<text class="shui">{{DworkerData.content}}</text> </view>
					<view class="contentSon_2">{{DworkerData.statename}}</view>
				</view>
				<view class="title">{{DworkerData.content}}</view>
				<view class="img" v-for="(item,index) in imagesUrl" :key="index">
		<!-- 			{{IMAGE_BASE_URL+item}} -->
					<image :src="item?IMAGE_BASE_URL+item:'../../static/images/bb.png'" mode=""></image>
				</view>
				<view class="time">{{DworkerData.addtime?DworkerData.addtime.substr(0,10):""}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getrepairsData} from "../../apis/index.js"
	import {IMAGE_BASE_URL} from "../../config/index.js"
	export default {
		props:{
			DworkerId:{
				type:String,
				default:""
			}
		},
		data() {
			return {
				IMAGE_BASE_URL:IMAGE_BASE_URL,
				DworkerIds:"",
				DworkerData:[],
				imagesUrl:[]
			}
		},
		
		mounted() {
			this.getrepairs()
		},
		methods: {
			// goBack(){
			// 	uni.navigateTo({
			// 		url:"/pages/warrantyList/warrantyList"
			// 	})
			// },
			async getrepairs(){
				this.DworkerIds=this.DworkerId
				console.log(this.DworkerIds);
				let res = await getrepairsData({id : this.DworkerIds})
				this.imagesUrl=res.images.map(item=>
					item.url				
				)
				console.log(this.imagesUrl);
				
				console.log("获取单条报修详情",res);
				
				this.DworkerData = res
				
			}
		}
	}
</script>

<style lang="less">
	page{
		background-color: #f0f0f0;
	}
	.header{
		display: flex;
		justify-content: center;
		padding-top: 65rpx;
		padding-bottom: 38rpx;
		background-color: white;
		position: relative;
		.return{
			font-size: 28rpx;
			color: #0f0f0f;
			position: absolute;
			left: 12rpx;
			.icon{
				font-size: 35rpx;
			}
		}
		.jilu{
			font-size: 28rpx;
			color: #0f0f0f;
		}
	}
	.center{
		margin-top: 20rpx;
		margin-left: 10rpx;
		margin-right: 10rpx;
		.content{
			background-color: white;
			.contentSon{
				margin-left: 35rpx;
				margin-right: 35rpx;
				display: flex;
				justify-content: space-between;
				border-bottom: 2rpx solid #f0f0f0;
				.contentSon_1{
					font-size: 28rpx;
					color: #666666;
					padding: 30rpx 0rpx 30rpx 0rpx;
					.shui{
						padding-left: 20rpx;
					}
				}
				.contentSon_2{
					font-size: 28rpx;
					color: #666666;
					padding: 30rpx 15rpx 30rpx 0rpx;
				}
			}
			.title{
				width: 588rpx;
				padding-top: 30rpx;
				padding-left: 35rpx;
				font-size: 28rpx;
				color: #333333;
				padding-bottom: 30rpx;
			}
			.img{
				padding-right: 80rpx;
				padding-left: 35rpx;
				padding-bottom: 30rpx;
				image{
					width: 100%;
					height: 400rpx;
					padding-bottom: 25rpx;
					position: relative;
				}
			}
			.time{
				margin-left: 35rpx;
				margin-right: 35rpx;
				border-top: 2rpx solid #f0f0f0;
				color: #666666;
				font-size: 28rpx;
				padding-top: 20rpx;
				padding-bottom: 30rpx;
			}
		}
	} 
</style>